﻿@model BBCateViewModel
@{
    ViewData["Menu"] = 8;
    ViewData["Title"] = "分类管理（超管）";
}

<main class="ftdms-layout-content">
    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-bordered">
                                <thead>
                                    <form asp-action="CateForm" asp-antiforgery="true" asp-route-id="0" method="post" class="site-form" autocomplete="off">
                                    <tr>
                                        <th>新增</th>
                                        <td><input type="number" class="form-control" name="flpx" id="flpx" placeholder="" value="1" required="required"></td>
                                        <td><input type="text" class="form-control" name="flmc" id="flmc" placeholder="" value="" required="required"></td>
                                        <td><div class="btn-group"><button type="submit" class="btn btn-primary">新增</button></div></td>
                                    </tr>
                                    </form>
                                    <tr>
                                        <th>ID</th>
                                        <th>排序（越大越靠前）</th>
                                        <th>名称</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    @if (Model != null && Model.CateList.Any())
                                    {
                                        foreach (var item in Model.CateList)
                                        {
                                            <form asp-action="CateForm" asp-antiforgery="true" asp-route-id="@item.id" method="post" id="formx-@(item.id)">
                                            <tr>
                                                <td>@item.id</td>
                                                <td><input type="number" class="form-control" name="flpx" id="flpx" placeholder="" value="@item.flpx" required="required"></td>
                                                <td><input type="text" class="form-control" name="flmc" id="flmc" placeholder="" value="@item.flmc" required="required"></td>
                                                <td>
                                                    <div class="btn-group">
                                                        <a class="btn btn-xs btn-default submenuitem" onclick="document.getElementById('formx-@(item.id)').submit(); return false;" title="修改" data-toggle="tooltip"><i class="ftsucai-edit-2"></i></a>
                                                        <a class="btn btn-xs btn-default submenuitem del" title="删除" href="javascript:if(confirm('确实要删除该内容吗?')) location='@Url.Action("CateDel",new { id = item.id})'" data-toggle="tooltip"><i class="ftsucai-del"></i></a>
                                                    </div>
                                                </td>
                                            </tr>
                                            </form>
                                        }
                                    }
                                </tbody>
                            </table>
                        </div>
                        <!-- 分页条码 -->
                        <pagination total-count="Model.ListCount"></pagination>
                        <!--End 分页条码 -->
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>
<!--End 页面主要内容-->